/*---------------------------
|+++++++++++++++++++++++++++|			
|	   Nguyen Duc Tai		|
|++++++++_THREAD_H_+++++++++|
---------------------------*/
#ifndef _THREAD_H_
#define _THREAD_H_

#include <pthread.h>

class Thread
{
protected:
	pthread_t		thread;			//thread
	pthread_attr_t	attribute;		//attribut

public:

	//create the thread
	void start();

	// join with the thread
	void join();

	//an abstract method, will be implemented in subclass, defines the behavior of thread
	virtual void run() = 0;

	//stop the thread
	void stop(); 

	//function to call Run
	static void *callFunction( void* threadId );

};
#endif